package com.sicau.utils;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Component
public class PdfParser {

    @Resource
    private PdfTextAndImageExtractor pdfTextAndImageExtractor;

    public String parsePdf(MultipartFile file) {
        try {
            return pdfTextAndImageExtractor.extractAllContent(file.getInputStream());
        } catch (Exception e) {
            return "解析失败";
        }
    }

}
